<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        button{
            width: 100px;
            height: 40px;
            margin: 10px;
        }
        .change{
            background: orange;
        }
    </style>
</head>
<body>
    <button>体育</button>
    <button>娱乐</button>
    <button>新闻</button>
    <button>教育</button>
    <div ></div>
</body>
<script>
    var btn=document.getElementsByTagName("button");

            document.getElementsByTagName("div")[0].style.display="block";
            document.getElementsByTagName("div")[0].style.height="300px";
            document.getElementsByTagName("div")[0].style.width="500px";
            document.getElementsByTagName("div")[0].style.border="1px solid grey";
            document.getElementsByTagName("div")[0].innerHTML=btn[0].innerText;
            btn[0].className="change";

    console.log(btn);
    for(var i=0;i<btn.length;i++)
    {   
        btn[i].onclick=function()
        {   
            
            for(var j=0;j<btn.length;j++)
            {
                btn[j].className='';
            }
            this.className='change';
            
           
            document.getElementsByTagName("div")[0].innerHTML=this.innerText;

        }
    }
</script>
</html>